package com.bindapp.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.bigkoo.pickerview.builder.TimePickerBuilder;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.TimePickerView;
import com.bindapp.R;
import com.bindapp.databinding.ActivityText3Binding;

import java.util.Date;

/**
 * Created by apple on 2018/7/12.
 */

public class Text3Activity extends AppCompatActivity{
    private ActivityText3Binding binding;

    private TimePickerView timePickerView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding=DataBindingUtil.setContentView(this, R.layout.activity_text3);
        initView();
        binding.submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                timePickerView.show();
            }
        });
        /*binding.webview.getSettings().setJavaScriptEnabled(true);
        binding.webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        binding.webview.getSettings().setSupportMultipleWindows(true);
        binding.webview.setWebViewClient(new WebViewClient());
        binding.webview.setWebChromeClient(new WebChromeClient());
        binding.webview.loadUrl(Static.TaoBao);*/


    }

    private void initView(){
        timePickerView=new TimePickerBuilder(this, new OnTimeSelectListener() {
            @Override
            public void onTimeSelect(Date date, View v) {
                Log.e("Mytext",""+date.getTime());
            }
        })
                .setType(new boolean[]{false, true, true, true, true, false})
                .setCancelText("取消")
                .setSubmitText("确定")
                .setOutSideCancelable(false)
                .setTitleText("请选择时间")
                .isCyclic(true)
                .isDialog(false)
                .build();
    }
}
